﻿<UserControl
    x:Class="vsarFlightPlan.StatusLegend"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:vsarFlightPlan"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:converters="using:vsarFlightPlan.Converters"
             mc:Ignorable="d" Loaded="UserControl_Loaded"
    d:DesignHeight="300"
    d:DesignWidth="400">
    <UserControl.Resources>
        <converters:StatusToBrush x:Key="StatusToBrushConverter" />
        <converters:StringFormatConverter x:Key="StringFormatConverter" />
        <converters:StatusToIcon x:Key="StatusToIcon" />
    </UserControl.Resources>

    <ListBox x:Name="LstProjectStatuses"
                 Background="Transparent">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <Border BorderThickness="0,0,0,1"
                            BorderBrush="White">
                    <StackPanel Orientation="Horizontal"
                                    MinHeight="50"
                                    Background="{Binding Path=Data, Converter={StaticResource StatusToBrushConverter}}">
                        <ContentControl Style="{Binding Path=Data, Converter={StaticResource StatusToIcon}}"
                                            HorizontalAlignment="Center" Padding="5"
                                            VerticalAlignment="Center" Margin="5"
                                            Height="50" Width="50" />
                        <TextBlock VerticalAlignment="Center"
                                       FontWeight="Bold" Foreground="White"
                                       TextWrapping="WrapWholeWords"
                                       HorizontalAlignment="Center"
                                       Text="{Binding Path=Data}" Margin="15,5,5,5"
                                       FontSize="25"
                                       Width="300" />
                    </StackPanel>
                </Border>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</UserControl>